﻿using System;
using System.IO;
using System.Text;

namespace _net_ex4_p3
{
    class Program
    {
        static void Main(string[] args)
        {
            string directory1 = "resoures/2/txt文件";
            string directory2 = "resoures/2/bmp文件";
            Directory.CreateDirectory(directory1);
            Directory.CreateDirectory(directory2);
            string content1 = "";
            string content2 = "";
            content1 = File.ReadAllText("resoures/1/1.txt",Encoding.GetEncoding("utf-8"));
            content2 = File.ReadAllText("resoures/1/2.txt",Encoding.GetEncoding("utf-8"));
            string myInfo = "2019071066杨洁龙";
            string content = content1 + content2 + myInfo;

            string filePath = directory1 + "/信息学院改名.txt";

            File.WriteAllText(filePath,content);

            string filePath2 = directory1 + "/2019071066杨洁龙.txt";
            var fileInfo = new FileInfo(filePath);
            string time = fileInfo.CreationTime.ToString();
            string length = fileInfo.Length.ToString();
            string readOnly = fileInfo.IsReadOnly.ToString();

            string message = time + "\n" +length+ "\n" +  readOnly;
            File.WriteAllText(filePath2,message);

            string file = "resoures/1/计算机显示数据.png";
            string path = "resoures/2/计算机显示数据/计算机显示数据.png";

            File.Copy(file,path,true);


            DirectoryInfo dir = new DirectoryInfo("resoures/1");
            string path1 = "resoures/2/bmp文件/";
            foreach (FileInfo fi in dir.GetFiles()) {
                if (fi.Length > 60000) {
                    fi.CopyTo(path1 + fi.Name,true);
                }
            }


        }
    }
}
